package com.struts.web.user.manage.jianli;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

import com.base.Constants;
import com.lg.system.CLGAction;
import com.struts.deal.user.register.Deal;
import com.struts.web.user.register.RegUserInfoForm;

public class ViewUserAction extends CLGAction {

	public ActionForward execute(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws
Exception {
		RegUserInfoForm aWebForm = (RegUserInfoForm)actionForm;
		ActionMessages msgs = new ActionMessages();
		boolean result = false;
		
		result = Deal.viewUserInfo(aWebForm, request);
			if(result == false){
				msgs.add("commonMsgs",new ActionMessage(Constants.NOTEXIST_OR_DEL));
				saveErrors(request,msgs);
				return actionMapping.findForward("fail");
			}else{
			return actionMapping.getInputForward();
			}
     }
	
}
